<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>

		<script type="text/javascript">
			// Object对象 提供了对象的最基本功能

			// 1. 创建对象
			var obj1 = new Object("abc123");
			console.log(obj1);
			console.log(obj1.constructor);

			var stu = {};
			stu.id = 1;
			stu.name = "张三";
			stu.age = 18;
			console.log(stu.id + "," + stu.name + "," + stu.age);

			var stu2 = {
				id: 2,
				name: "李四",
				age: 19
			};
			console.log(stu2.id + "," + stu2.name + "," + stu2.age);

			var stu3 = {};
			stu3["id"] = 3;
			stu3["name"] = "王五"
			stu3["age"] = 18;
			console.log(stu3["id"] + "," + stu3["name"] + "," + stu3["age"]);

			var person = {
				firstname: "zhang",
				lastname: "san",
				fullname: function() {
					return this.firstname + this.lastname;
				}
			};
			console.log(person.fullname())
		</script>

	</body>
